﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using TrenchcoatRobots.Datatypes;

namespace TrenchcoatRobots.Classes {
	/// <summary>
	/// This is the base class of all Components. It will never be instantiated (created with new)
	/// NOTE: m_parent is a COPY of the Parent(). Needs to be fixed
	/// </summary>
	abstract class Component {
		public delegate GameObject ParentMethod();

		public bool Single { get; private set; }
		public ParentMethod Parent { get; private set; }
		string Type { get; set; }

		/// <summary>
		/// Creates a new Component/object
		/// </summary>
		/// <param name="parent">The GameObject of which the component will be placed on. Delegate to the ReturnSelf</param>
		/// <param name="type">The type of the component</param>
		public Component( ParentMethod gameObjectMethod, string type, bool single ) {
			Parent = gameObjectMethod;
			Single = single;
			Type = type;
		}

		#region Methods
		public virtual void Update( ref GameTime gameTime ) {
			return;
		}

		public virtual void Draw( ref SpriteBatch spriteBatch, ref TrenchcoatRobots.Datatypes.DrawInfo drawinfo ) {
			return;
		}

		public virtual void Collided( GameObject otherCopy, CollisionInfo collisionInformation ) {
			return;
		}
		#endregion
	}
}
